package com.runfast.waimai.service.impl;

import com.runfast.common.service.BaseService;
import com.runfast.waimai.dao.mapper.RunfastGoodsSellMapper;
import com.runfast.waimai.dao.model.RunfastGoodsSell;
import com.runfast.waimai.dao.model.RunfastGoodsSellExample;
import com.runfast.waimai.entity.CartItem;
import com.runfast.waimai.service.RunfastGoodsSellService;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RunfastGoodsSellServiceImpl extends BaseService<RunfastGoodsSell, Integer, RunfastGoodsSellExample> implements RunfastGoodsSellService {
    @Override
<<<<<<< .mine
    public void updateSalesnum(RunfastGoodsSell gr) {
        dao.updateSalesnum(gr);
||||||| .r24
    public void updateSalesnum(RunfastGoodsSellRecord gr) {
        dao.updateSalesnum(gr);
=======
    public RunfastGoodsSellMapper getMapper() {
        return (RunfastGoodsSellMapper)super.getMapper();
>>>>>>> .r34
    }

    @Override
    public List<RunfastGoodsSell> search(String name, Integer businessId, Pageable pageable) {
        RunfastGoodsSellMapper goodsSellMapper = getMapper();
        List<RunfastGoodsSell> goodsSellList = goodsSellMapper.search(name, businessId, pageable);
        return goodsSellList;
    }


    @Override
    public List<Map<String, Object>> findAgentOffZoneGoods(Integer agentId, Pageable pageable){

        RunfastGoodsSellMapper mapper = getMapper();
        return mapper.findAgentOffZoneGoods(agentId, pageable);
    }

    @Override
    public RunfastGoodsSell detail(Integer goodsId) {
        return getMapper().detail(goodsId);
    }

    @Override
    public List<RunfastGoodsSell> findGoodsWithStandar(Integer businessId, List<CartItem> cart) {
        return getMapper().findGoodsWithStandar(businessId, cart);
    }

    @Override
    public List<RunfastGoodsSell> findGoodsWithOption(Integer businessId, List<CartItem> cart) {
        return getMapper().findGoodsWithOption(businessId, cart);
    }

    @Override
    public List<Map<String, Object>> checkGoodsWithStandar(Integer businessId, List<CartItem> cart) {
        return getMapper().checkGoodsWithStandar(businessId, cart);
    }

    @Override
    public List<Map<String, Object>> checkGoodsWithOption(Integer businessId, List<CartItem> cart) {
        return getMapper().checkGoodsWithOption(businessId, cart);
    }
}